package com.itheima.demo;


import java.io.FileInputStream;
import java.io.FileOutputStream;

public class Demo_File_003 {
    public static void main(String[] args) throws Exception {
        FileOutputStream fos = new FileOutputStream("demo_file\\aaa.txt");
        //write​(int b)
        fos.write('9');
        //write​(byte[] b)
        byte[] arr = {11, 12, 14, 15, 17, 18, 19, 87, 98, 86};
        //回车换行:\r\n
        fos.write(arr);
        //write​(byte[] b, int off, int len)
        fos.write(arr, 1, 7);
        fos.close();
        FileInputStream fis = new FileInputStream("demo_file\\aaa.txt");
        int read = fis.read();
        int read1 = fis.read();
        int read2 = fis.read();
        System.out.println(read);
        System.out.println(read1);
        System.out.println(read2);
    }
}
